<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<style>
    body {text-align: center;}
    .app {
        position: relative;
        height: 100%;
    }
    .content-wrap {
        position: relative;
        height: 100%;
    }
    .table {
        width:60%;
        border-spacing:0;
        margin-bottom: 10px;
        background-color:transparent;
        margin:0 auto;
    }
    .no-m {
        margin: 0!important;
    }
    tbody > tr > td, .table > tfoot > tr > td {
        border-color: #e3e6f3;
    }
    .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
        padding: 8px;
        line-height: 1.42857143;
        vertical-align: top;
        border-top: 1px solid #ddd;
    }
    td, th {
        display: table-cell;
        vertical-align: inherit;
    }
    .text-center{
        text-align: center;
    }
</style>
<div class="app">
    <div class="content-wrap">
        <div class="text-center">
            <p style="font-size: 24px;font-weight:bold ">安平博爱医院</p>
            <p style="font-size: 18px;font-weight:bold ">病人费用清单</p>
        </div>
        <div>
            <span>清单日期：${startDate}至${endDate}</span>
            <span style="padding-left:360px;">打印时间:${date}</span>
        </div>
               <div  align="center">
                   <table class="table no-m">
                       <thead>
                       <tr>
                           <th>住院号</th>
                           <th>姓名</th>
                           <th>床</th>
                           <th>项目名称</th>
                           <th>规格</th>
                           <th>数量</th>
                           <th>单位</th>
                           <th>计价金额</th>
                           <th>应收金额</th>
                       </tr>
                       </thead>
                       <tbody>
                       <c:forEach items="${billDetails}" var="billDeatils" varStatus="status">
                           <tr>
                               <c:choose>
                                   <c:when test="${status.count==1}">
                                       <td>${billDeatils.visit_no}</td>
                                       <td>${billDeatils.bed_no}</td>
                                       <td>${billDeatils.name}</td>
                                   </c:when>
                                   <c:otherwise>
                                       <td></td>
                                       <td></td>
                                       <td></td>
                                   </c:otherwise>
                               </c:choose>
                               <td>${billDeatils.item_name}</td>
                               <td>${billDeatils.item_spec}</td>
                               <td>${billDeatils.amount}</td>
                               <td>${billDeatils.units}</td>
                               <td>${billDeatils.costs}</td>
                               <td>${billDeatils.charges}</td>
                               <c:set var="totalCosts" value="${billDeatils.total_costs+totalCosts}"></c:set>
                               <c:set var="totalCharges" value="${billDeatils.total_charges+totalCharges}"></c:set>
                           </tr>
                       </c:forEach>
                       <tr>
                           <td></td>
                           <td></td>
                           <td></td>
                           <td></td>
                           <td></td>
                           <td></td>
                           <td>合计：</td>
                           <td><c:out value="${totalCosts}"></c:out></td>
                           <td><c:out value="${totalCharges}"></c:out></td>
                       </tr>
                       </tbody>
                   </table>
               </div>


 </div>
    </div>
